﻿


using System;
using System.Text;
using System.Collections;
using System.Xml;
using System.Data;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Resources;
using System.Reflection;
using System.Globalization;
using System.Threading;

using Telerik.WebControls;
using UFSoft.UBF.UI.WebControls;
using UFSoft.UBF.UI.WebControls.InterActionComponenet;
using UFSoft.UBF.Util.Log;
using UFSoft.UBF.Util.Context;

//using MagicAjax.UI.Controls;
using UFSoft.UBF.Report.UI.ReportView.Web;
using UFSoft.UBF.UI.WebControlAdapter;
using UFSoft.UBF.UI.FormProcess;
using UFSoft.UBF.UI.IView;
using UFSoft.UBF.UI.Engine;
using UFSoft.UBF.UI.Engine.Builder;
using UFSoft.UBF.UI.Engine.Authorization;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.ActionProcess;
using UFSoft.UBF.UI.ControlModel;
using UFSoft.UBF.UI.Controls;
using UFSoft.UBF.UI.WebControls.Association;
using UFSoft.UBF.UI.WebControls.ClientCallBack;
using System.Web.UI;
using UFSoft.UBF.UI.UIFormPersonalization;
using System.Collections.Specialized;


/***********************************************************************************************
 * Form ID:631371b7-abb9-423f-8a2d-0f93b47870e5 
 * Form Name:QCGuideUpdateForm
 * UIFactory Auto Generator
 ***********************************************************************************************/
namespace QCGuideUpdateUIModel
{
	[FormRegister("UFIDA.U9.Learn.ItemUI","QCGuideUpdateUIModel.QCGuideUpdateFormWebPart", "UFIDA.U9.Learn.ItemUI.WebPart", "631371b7-abb9-423f-8a2d-0f93b47870e5","WebPart", "True", 630, 375)] 
	///insert into aspnet_Parts (SysVersion, Path, ClassName, [Assembly], FormId) values (0, 'UFIDA.U9.Learn.ItemUI', 'QCGuideUpdateUIModel.QCGuideUpdateFormWebPart', 'UFIDA.U9.Learn.ItemUI.WebPart', '631371b7-abb9-423f-8a2d-0f93b47870e5')
	///<siteMapNode url="~/erp/simple.aspx?lnk=631371b7-abb9-423f-8a2d-0f93b47870e5" title="QCGuideUpdateForm"/>
    public partial class QCGuideUpdateFormWebPart : UFSoft.UBF.UI.FormProcess.BaseWebForm
    {
		#region Page Controller/Code Behind
        private static readonly ILogger logger = LoggerManager.GetLogger(typeof(QCGuideUpdateFormWebPart));
        private string assemblyName = System.Reflection.Assembly.GetExecutingAssembly().FullName;
        //private string displayNamePostfix = "displayName";

		#region 强类型化基类属性.
		public new QCGuideUpdateUIModelAction Action
		{
			get { return (QCGuideUpdateUIModelAction)base.Action; }
			set { base.Action = value; }
		}
		QCGuideUpdateUIModelModel _uimodel=null;
		public new QCGuideUpdateUIModelModel Model
		{
			get 
			{
			     if(_uimodel == null){
			          _uimodel = new QCGuideUpdateUIModelModel();
			     }
			     return _uimodel; 
			}
			set { _uimodel = value; }
		}
        protected override IUIModel UIModel{
            get{
                return this.Model;
            }
            set{
                this.Model = value as QCGuideUpdateUIModelModel;
            }
        }
		#endregion 
		public FormAdjust adjust;
        #region variable declaration
        IUFCard Card0;
        IUFLabel lblQCGuideLine198;
        IUFFldReference QCGuideLine198;
        IUFLabel lblQCGuideLine2145;
        IUFFldReference QCGuideLine2145;
        IUFDataGrid DataGrid0;
        IUFCard Card1;
        IUFButton UpdateClick378;
		UpdatePanel updatePanel;
		HiddenField wpFindID;
		IUFContainer topLevelPanel;     
        IUFSeparator SeparatorInFavorites;
        IUFButton BtnDefaultValues;
        #endregion
        
        #region constructor
        public QCGuideUpdateFormWebPart()
        {
            FormID = "631371b7-abb9-423f-8a2d-0f93b47870e5";
            IsAutoSize = bool.Parse("False");
            NewIsAutoSize = bool.Parse("False");
        }
        #endregion


	
            
	//获取档案版型结果: 

        #region eventBind and databind
        private void EventBind()
        {
			//事件绑定模板
							
				//Button控件事件
			this.UpdateClick378.Click += new EventHandler(UpdateClick378_Click);		
						

		
			//Grid控件的分页事件				
			((UFWebDataGridAdapter)this.DataGrid0).GridMakePageEventHandler += new GridMakePageDelegate(UFGridDataGrid0_GridMakePageEventHandler);
             //Grid控件的客户化筛选，定位事件
            ((UFWebDataGridAdapter)this.DataGrid0).GridCustomFilterHandler += new GridCustomFilterDelegate(UFGridDataGrid0_GridCustomFilterHandler);

            AfterEventBind();
        }
        #endregion            
        
		#region override method
		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad2(e);
		}
		protected override void OnLoadDataDo(EventArgs e)
		{
		    adjust.ProcessAdjustBeforeOnLoad(this);
			if (UIEngineHelper.IsDataBind(PageStatus, this))
			{
				if(this.Model==null){				        
					this.Model = new QCGuideUpdateUIModelModel();
				}
				OnLoadConsumer(new InParameterModel[]{},new InParameterModel[]{});
				OnLoadData(this);
				this.IsDataBinding = true ; //加载完数据要绑定一次.目前加这.
			}
			else
			{
				//去除.已经移入到OnInit()中.
				//this.Model = (QCGuideUpdateUIModelModel)this.CurrentState[this.TaskId.ToString()];
			}
			adjust.ProcessAdjustAfterOnLoadData(this);
		            AfterOnLoad();
            
            adjust.ProcessAdjustAfterOnLoad(this);
		}
		protected override void OnPreRender(EventArgs e)
		{
			base.OnPreRender2(e);
		}
        protected override void OnPreRenderDo(EventArgs e)
        {
            adjust.ProcessAdjustBeforeOnPreRender(this);
			base.OnPreRender(e);
			this.CurrentState[this.TaskId.ToString()] = this.Model;
			RegisterClearWebPartPadding();
            UFIDA.U9.UI.PDHelper.FormAuthorityHelper.SetWebPartAuthorization(this);
            
			if (IsDataBinding) //2006-9-7 可由开发人员控制
			{
				BeforeUIModelBinding();
								if(!Page.IsPostBack)
				{
					EnumTypeBinding.BindEnumControls(this);
				}
				UFIDA.U9.UI.Commands.CommandHelper.BindFlexData(this);
				adjust.ProcessAdjustBeforeDataBinding(this);
				if (this.IsOnlyDataBinding)
				{
					this.DataBinding();
				}
				adjust.ProcessAdjustAfterDataBinding(this);

				AfterUIModelBinding();
			}
			adjust.ProcessAdjustAfterOnPreRender(this);
        }
		protected override void OnInit(EventArgs e)
		{
			base.OnInit2(e);
		}
		protected override void OnInitDo(EventArgs e)
		{			 
			this.Page.InitComplete += new EventHandler(Page_InitComplete);
			WebPartBuilder.InitWebPart(this);
            this.Action = new QCGuideUpdateUIModelAction(this);
            adjust = new FormAdjust();
		    CreateFormChildControls();
		}
        void Page_InitComplete(object sender, EventArgs e)
        {

            adjust.ProcessInit(this);
        }
        #endregion

      
        
        #endregion

	
		/// <summary>
        /// WebPart View
        /// </summary>
        #region view Create Contorls
        private void CreateFormChildControls()
        {
            IUFContainer _panel = UIControlBuilder.BuildTopLevelContainer(this,"QCGuideUpdateForm",true,630,375);
            CommonBuilder.ContainerGridLayoutPropBuilder(_panel, 1, 2, 0, 10, 10, 10, 10, 10);
			InitViewBindingContainer(this, _panel,  null, "", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_panel, 10,new GridColumnDef[]{new GridColumnDef(610,bool.Parse("True"),"Title"),},new GridRowDef[]{new GridRowDef(320,bool.Parse("True")),new GridRowDef(25,bool.Parse("True")),});
            //???还有用么?
            topLevelPanel = _panel;    
            
            UIControlBuilder.BuildCommonControls(this,ref updatePanel,ref wpFindID);
            





	
			_BuilderControl_Card0(_panel);

		
			UIControlBuilder.BuilderUFControl(this.Card0, "1");		


	
			_BuilderControl_Card1(_panel);

		
			UIControlBuilder.BuilderUFControl(this.Card1, "2");		



		
     
			
			
            EventBind();
            AfterCreateChildControls();
            
        }        







	                   
        private IUFCard _BuilderControl_Card0(IUFContainer container)
        {
            IUFCard _UFCard = UIControlBuilder.BuildCard(container,"Card0",false,"none", true, true, "1","10684abe-f906-489c-90dc-d05e0af99028","5be5dfa6-c14c-4a02-817c-d73f9c8738ef");
			CommonBuilder.GridLayoutPropBuilder(container, _UFCard, 610, 320, 0, 0, 1, 1, "100");
            CommonBuilder.ContainerGridLayoutPropBuilder(_UFCard, 11, 13, 0, 5, 0, 0, 0, 0);
			InitViewBindingContainer(this, _UFCard,  this.Model.QCGuideMainView, "QCGuideMainView", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_UFCard, 5,new GridColumnDef[]{new GridColumnDef(90,bool.Parse("True"),"Title"),new GridColumnDef(5,bool.Parse("True"),"Spacing"),new GridColumnDef(90,bool.Parse("True"),"Value"),new GridColumnDef(20,bool.Parse("True"),"Spacing"),new GridColumnDef(90,bool.Parse("True"),"Title"),new GridColumnDef(5,bool.Parse("True"),"Spacing"),new GridColumnDef(90,bool.Parse("True"),"Value"),new GridColumnDef(20,bool.Parse("True"),"Spacing"),new GridColumnDef(90,bool.Parse("True"),"Title"),new GridColumnDef(5,bool.Parse("True"),"Spacing"),new GridColumnDef(89,bool.Parse("True"),"Value"),},new GridRowDef[]{new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),});
            this.Card0 = _UFCard;

            ///foreach UFCard下的所有控件，增加到此容器





				this.lblQCGuideLine198 = UIControlBuilder.BuilderUFLabel(_UFCard, "lblQCGuideLine198", "", "True", "True", "Right", 90, 20, 0, 1, 1, 1, "100","10684abe-f906-489c-90dc-d05e0af99028","71b2d95e-d622-4c7e-b7a1-ca09cb2803d9");


								

		
			UIControlBuilder.BuilderUFControl(this.lblQCGuideLine198, "0");		


				this.QCGuideLine198 = UIControlBuilder.BuilderRefrenceControl(_UFCard,"QCGuideLine198",true,true, true,90, 20, 2, 1, 1, 1, "100","1",false,false,true,"lblQCGuideLine198","10684abe-f906-489c-90dc-d05e0af99028","ce749b4b-eabf-4030-b083-948bc47fdc93");
			UIControlBuilder.BuilderUIFieldBindingControl(this, this.QCGuideLine198, "False", "QCGuideLine1", this.Model.QCGuideMainView, this.Model.QCGuideMainView.FieldQCGuideLine1, "QCGuideMainView");
			UIControlBuilder.SetReferenceControlRefInfo(this.QCGuideLine198,"c7f336ec-f405-4bab-86be-9766b365cb60", 580,408, "Name","Code","ID", this.Model.QCGuideMainView.FieldQCGuideLine1_Code,this.Model.QCGuideMainView.FieldQCGuideLine1_Name);
            //foreach Reference's input filter parameter
            //foreach Reference's output set data, columnID锛屽弬鐓ц繑鍥炲垪鐨凢ieldID
			ScriptBuilder.BuildReferenceControlOuputScript(this.QCGuideLine198,"QCGuideLine198",new ReferenceOutputParam[]{new ReferenceOutputParam("","ID",""),new ReferenceOutputParam("","Code",""),new ReferenceOutputParam("","Name",""),new ReferenceOutputParam("","Remark",""),});
		
			this.QCGuideLine198.ContentChanged += new EventHandler(QCGuideLine198_TextChanged);
			this.QCGuideLine198.AutoPostBack = true;
		

		
			UIControlBuilder.BuilderUFControl(this.QCGuideLine198, "1");		
		 

				this.lblQCGuideLine2145 = UIControlBuilder.BuilderUFLabel(_UFCard, "lblQCGuideLine2145", "", "True", "True", "Right", 90, 20, 4, 1, 1, 1, "100","9e18da3b-86e7-48e4-9250-94ae2d4d72f6","b9cb2083-1a66-4aba-82a1-1fc30c738b85");


								

		
			UIControlBuilder.BuilderUFControl(this.lblQCGuideLine2145, "2");		


				this.QCGuideLine2145 = UIControlBuilder.BuilderRefrenceControl(_UFCard,"QCGuideLine2145",true,true, true,90, 20, 6, 1, 1, 1, "100","3",false,false,true,"lblQCGuideLine2145","9e18da3b-86e7-48e4-9250-94ae2d4d72f6","9f0401d4-89b0-42c8-bb8a-68b10a752c57");
			UIControlBuilder.BuilderUIFieldBindingControl(this, this.QCGuideLine2145, "False", "QCGuideLine2", this.Model.QCGuideMainView, this.Model.QCGuideMainView.FieldQCGuideLine2, "QCGuideMainView");
			UIControlBuilder.SetReferenceControlRefInfo(this.QCGuideLine2145,"c7f336ec-f405-4bab-86be-9766b365cb60", 580,408, "Name","Code","ID", this.Model.QCGuideMainView.FieldQCGuideLine2_Code,this.Model.QCGuideMainView.FieldQCGuideLine2_Name);
            //foreach Reference's input filter parameter
            //foreach Reference's output set data, columnID锛屽弬鐓ц繑鍥炲垪鐨凢ieldID
			ScriptBuilder.BuildReferenceControlOuputScript(this.QCGuideLine2145,"QCGuideLine2145",new ReferenceOutputParam[]{new ReferenceOutputParam("","ID",""),new ReferenceOutputParam("","Code",""),new ReferenceOutputParam("","Name",""),new ReferenceOutputParam("","Remark",""),});
				

		
			UIControlBuilder.BuilderUFControl(this.QCGuideLine2145, "3");		
		 

	
			_BuilderControl_DataGrid0(_UFCard);

		
			UIControlBuilder.BuilderUFControl(this.DataGrid0, "4");		



		
			this.QCGuideLine198.IsMultiOrg  = false ;
			this.lblQCGuideLine198.SetMultiOrgInfo(this.QCGuideLine198,false);
			
		
			this.QCGuideLine2145.IsMultiOrg  = false ;
			this.lblQCGuideLine2145.SetMultiOrgInfo(this.QCGuideLine2145,false);
			
	

            
            container.Controls.Add(_UFCard);
            return _UFCard;
        }

				

				

				





       
        private void _BuilderControl_DataGrid0(IUFContainer container)
        {
            IUFDataGrid _UFGrid = UIControlBuilder.BuildGridControl("DataGrid0", UFSoft.UBF.UI.ControlModel.EditStatus.Edit, true, true,true,true,true,true,20,false, false) ;
  			UIControlBuilder.BuilderUFControl(_UFGrid, "True", "True", "4");
			CommonBuilder.GridLayoutPropBuilder(container, _UFGrid, 500, 245, 0, 3, 9, 10, "100");
			InitViewBindingContainer(this, _UFGrid,  this.Model.QCGuideLineView, "QCGuideLineView", "", null, 20, "");
			((UFSoft.UBF.UI.WebControlAdapter.UFWebDataGridAdapter)_UFGrid).PagingStrategy=UFSoft.UBF.UI.ControlModel.GridPagingStrategy.Auto;
			_UFGrid.AllowSelectAllPage=false;
			((UFSoft.UBF.UI.WebControls.UFGrid)_UFGrid).IsSumAllData=false;
		        ((UFSoft.UBF.UI.WebControls.UFGrid)_UFGrid).IsSumSelectedData=false;
            this.DataGrid0 = _UFGrid;
            container.Controls.Add(_UFGrid);



			IUFDataGridColumn column ;
			GridColumn gridColumn ;
	                     
			column = GridControlBuilder.GridColumnBuilder(_UFGrid,"QCSchema","ReferenceColumnModel", "", 0,this.Model.QCGuideLineView.Fields["QCSchema"]/*QCSchema*/,"QCSchema", false, true, true, false, false, false, 7, 100, "19.0",true, false,"","3f7859d4-889a-4d97-b40e-0334aea73783","3f7859d4-889a-4d97-b40e-0334aea73783","faa2ffa4-51d6-4f55-95c2-219c2652fd51");
			GridControlBuilder.GridReferenceColumnBuilder((IUFFldReferenceColumn)column, ColumnTextAlign.Right, "ID", "Code", "QCSchemaHead_Name", this.Model.QCGuideLineView.FieldQCSchema_Code/*QCSchema_Code*/, this.Model.QCGuideLineView.FieldQCSchema_Name/*QCSchema_Name*/, "3b34a8b3-a9cd-41c1-b7cb-aa25cb8ceebb"
			,false,true,580,408);
            ((IUFFldReferenceColumn)column).CtrlId = "faa2ffa4-51d6-4f55-95c2-219c2652fd51";
 			((IUFFldReferenceColumn)column).IsMultiOrg  = false ;
           //foreach Reference's input filter parameter

            //foreach Reference's output set data
							
							
							
							
							
							
            ((IUFFldReferenceColumn)column).ApplyRefRelations();
			  
		 	                     
			column = GridControlBuilder.GridColumnBuilder(_UFGrid,"QCSchema_Code","TextBoxColumnModel", "", 0,this.Model.QCGuideLineView.Fields["QCSchema_Code"]/*QCSchema_Code*/,"QCSchema_Code", false, true, true, false, false, false, 0, 100, "50",true, false,"","e0bbd4df-3b82-40cc-aa3d-38a6bdcba780","e0bbd4df-3b82-40cc-aa3d-38a6bdcba780","425fdd85-abc6-4c07-9ff7-701fa0e8cc01");
         
			GridControlBuilder.GridTextBoxColumnBuilder((IUFTextBoxColumn)column,"",TextAlign.Left, false,"",false,"1","1","50") ;          
	  
		 	                     
			column = GridControlBuilder.GridColumnBuilder(_UFGrid,"QCSchema_Name","TextBoxColumnModel", "", 0,this.Model.QCGuideLineView.Fields["QCSchema_Name"]/*QCSchema_Name*/,"QCSchema_Name", false, true, true, false, false, false, 0, 100, "50",true, false,"","f34c8d5d-bc03-47d0-b08f-326f61508a26","f34c8d5d-bc03-47d0-b08f-326f61508a26","a052a54a-361f-4c42-a5b1-66f412fc59b4");
         
			GridControlBuilder.GridTextBoxColumnBuilder((IUFTextBoxColumn)column,"",TextAlign.Left, false,"",false,"1","1","50") ;          
	  
		 	                     
			column = GridControlBuilder.GridColumnBuilder(_UFGrid,"Version","TextBoxColumnModel", "", 0,this.Model.QCGuideLineView.Fields["Version"]/*Version*/,"Version", false, true, true, false, false, false, 0, 100, "50",true, false,"","ea23c95a-4c5c-4d32-88f8-961749bcb9d4","ea23c95a-4c5c-4d32-88f8-961749bcb9d4","b7c68af9-a872-47dc-b3ab-b69d8da82246");
         
			GridControlBuilder.GridTextBoxColumnBuilder((IUFTextBoxColumn)column,"",TextAlign.Left, false,"",false,"1","1","50") ;          
	  
		 	                     
			column = GridControlBuilder.GridColumnBuilder(_UFGrid,"ID","TextBoxColumnModel", "", 0,this.Model.QCGuideLineView.Fields["ID"]/*ID*/,"ID", true, false, true, false, false, false, 7, 100, "",true, false,"","583363b7-224b-42c4-80b1-767461c3c354","583363b7-224b-42c4-80b1-767461c3c354","64ce1c66-1e71-473d-be15-71f8e1ae06ef");
         
			GridControlBuilder.GridTextBoxColumnBuilder((IUFTextBoxColumn)column,"",TextAlign.Right, false,"",false,"1","1","") ;          
	  
		 
        }

	                   
        private IUFCard _BuilderControl_Card1(IUFContainer container)
        {
            IUFCard _UFCard = UIControlBuilder.BuildCard(container,"Card1",false,"FunctionBar", true, true, "2","","0a3f5634-6060-435b-9a17-fe8bc45b56b8");
			CommonBuilder.GridLayoutPropBuilder(container, _UFCard, 610, 25, 0, 1, 1, 1, "100");
            CommonBuilder.ContainerGridLayoutPropBuilder(_UFCard, 11, 1, 0, 0, 0, 0, 10, 0);
			InitViewBindingContainer(this, _UFCard,  null, "", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_UFCard, 0,new GridColumnDef[]{new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(60,bool.Parse("True"),"Value"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(30,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),},new GridRowDef[]{new GridRowDef(20,bool.Parse("True")),});
            this.Card1 = _UFCard;

            ///foreach UFCard下的所有控件，增加到此容器





				this.UpdateClick378 = UIControlBuilder.BuilderUFButton(_UFCard, true, "UpdateClick378", true, true, 170, 20, 5, 0, 3, 1, "100","", this.Model.ElementID,"UpdateClick",false,"595c7b82-d710-4254-a2b7-9d2f9819e105","595c7b82-d710-4254-a2b7-9d2f9819e105","67fe708a-4e33-49fa-81b1-211dd3d2667b");
	

		
			UIControlBuilder.BuilderUFControl(this.UpdateClick378, "0");		



	

            
            container.Controls.Add(_UFCard);
            return _UFCard;
        }





		#endregion
		

	}
}
